/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller, middleware } = app;

  router.get('/car/common', middleware.jwtHandler(), controller.car.common.index);
  router.post('/car/common/update', middleware.jwtHandler(), controller.car.common.update);
  router.post('/car/common/create', controller.car.common.create);
  router.delete('/car/common/:id', middleware.jwtHandler(), controller.car.common.destroy);
  router.get('/car/common/download', middleware.jwtHandler(), controller.car.common.download);

  router.get('/car/bengteng', middleware.jwtHandler(), controller.car.bengteng.index);
  router.post('/car/bengteng/create', controller.car.bengteng.create);
  router.post('/car/bengteng/update', middleware.jwtHandler(), controller.car.bengteng.update);
  router.delete('/car/bengteng/:id', middleware.jwtHandler(), controller.car.bengteng.destroy);
  router.get('/car/bengteng/download', middleware.jwtHandler(), controller.car.bengteng.download);

  router.get('/car/mazida', middleware.jwtHandler(), controller.car.mazida.index);
  router.post('/car/mazida/create', controller.car.mazida.create);
  router.post('/car/mazida/update', middleware.jwtHandler(), controller.car.mazida.update);
  router.delete('/car/mazida/:id', middleware.jwtHandler(), controller.car.mazida.destroy);
  router.get('/car/mazida/download', middleware.jwtHandler(), controller.car.mazida.download);

  router.get('/car/biyadi', middleware.jwtHandler(), controller.car.biyadi.index);
  router.post('/car/biyadi/update', middleware.jwtHandler(), controller.car.biyadi.update);
  router.post('/car/biyadi/create', controller.car.biyadi.create);
  router.delete('/car/biyadi/:id', middleware.jwtHandler(), controller.car.biyadi.destroy);
  router.get('/car/biyadi/download', middleware.jwtHandler(), controller.car.biyadi.download);

  router.get('/car/neza', middleware.jwtHandler(), controller.car.neza.index);
  router.post('/car/neza/update', middleware.jwtHandler(), controller.car.neza.update);
  router.post('/car/neza/create', controller.car.neza.create);
  router.delete('/car/neza/:id', middleware.jwtHandler(), controller.car.neza.destroy);
  router.get('/car/neza/download', middleware.jwtHandler(), controller.car.neza.download);
};
